@extends('homeLayouts.jiesuan_master')
@section('content')
    <div class="beij_center">
        <div class="checkout-tit">
            <span class="tit-txt">填写并核对订单信息</span>
        </div>
        <div class="checkout_steps">
            <div class="step-tit">
                <h3>收货人信息</h3>
                <div class="extra_r">
                    <a href="" class="ftx-05 J_consignee_global">新增收货地址</a>
                </div>
            </div>
            <div class="jies_y_shouh_diz shiq_1">
                <ul>
                    @foreach($addresses as $address)
                    <li class="{{$address['is_default']?'cur':''}}">
                        <div class="dangq_xuanz_diz">当前地址</div>
                        <span>{{$address['linkman']}}</span>
                        <span>{{$address['area'].$address['address']}}</span>
                        <span>{{$address['phone']}}</span>
                        <div class="bianji_yv_shanc">
                            @if($address['is_default'])
                                <span>当前默认地址</span>
                            @else
                                <a href="{{route('home.setDefault',$address)}}">设为默认</a>
                            @endif
                        </div>
                    </li>
                    @endforeach
                </ul>
                <div class="addr-switch cur_e">
                    <p><span>更多地址</span><b></b></p>
                    <p class="jiant_xiangs"><span>收起更多</span><b></b></p>
                </div>
            </div>
            <div class="jies_y_shouh_diz shiq_2">
                <ul>
                    <li class="zhif_fangs cur"><div class="dangq_xuanz_diz">在线支付</div></li>
                    <li class="zhif_fangs"><div class="dangq_xuanz_diz">货到付款</div></li>
                    <div class="addr-switch addr_switch_1 cur_e_1">
                        <p><span>更多 >></span></p>
                        <p><span>收起 <<</span></p>
                    </div>
                </ul>
            </div>
            <div class="step-tit">
                <h3>送货清单</h3>
                <div class="extra_r">
                    <a href="#" class="ftx-05 J_consignee_global">价格说明</a>
                    <a href="#" class="ftx-05 J_consignee_global">返回修改购物车</a>
                </div>
            </div>
            <div class="shopping_list">
                <div class="dis_modes">
                    <div class="mode_item_tit">
                        <h4>配送方式</h4>
                    </div>
                    <div>
                        <div class="jies_y_shouh_diz jies_y_shouh_diz_kuaid">
                            <ul>
                                <li class="zhif_fangs cur"><div class="dangq_xuanz_diz">申通快递</div></li>
                                <li class="zhif_fangs"><div class="dangq_xuanz_diz">圆通快递</div></li>
                            </ul>
                        </div>
                    </div>
                    <div class="peis_shij">
                        <p>配送时间： </p><span>工作日、双休日与节假日均可送货</span>
                    </div>
                    <div class="maij_liuy">
                        <p>给商家留言</p>
                        <input type="text" value="最多不能超过30字！">
                    </div>
                </div>
                <div class="goods_list">
                    @foreach($carts as $v)
                    <div class="goods_list_neik">
                        <div class="goods_item">
                            <div class="p_img"><a href="#"><img src="{{$v['goods']['pics'][0]}}"></a></div>
                            <div class="goods_msg">
                                <div class="p_name">
                                    <a href="#">{{$v['goods']['name']}}</a>
                                </div>
                                <div class="p_price">
                                    <span class="jq_price">￥ {{$v['goods']['price']}}</span>
                                    <span>x{{$v['num']}}</span>
                                    <span>有货</span>
                                </div>
                            </div>
                        </div>
                    </div>
                    @endforeach
                </div>
            </div>
            <div class="fap_beij">
                <div class="step-tit">
                    <h3>发票信息</h3>
                </div>
                <div class="kaif_p">
                    <span>普通发票（电子)</span>
                    <span>个人</span>
                    <span> 明细 </span>
                    <span> <a href="#">修改</a> </span>
                </div>
            </div>
        </div>
        <!--收费明细-->
        <div class="order_summary">
            <div class="qianq_mx">
                <div class="jiaq_meih">
                    <span class="xiangq_leib"><em class="goumai_ges">{{count($carts)}}</em> 件商品，总商品金额：</span>
                    <em class="goum_zongj">￥{{$total}}</em>
                </div>
            </div>
        </div>
        <div class="trade_foot_detail_com">
            <div class="dsgs">
                <div class="qianq_mx">
                    <div class="jiaq_meih">
                        <span class="xiangq_leib"> 应付总额：</span>
                        <em class="goum_zongj zhongf_jine">￥{{$total}}</em>
                    </div>
                </div>
            </div>
            <div class="zuiz_diz">
                <span>寄送至： {{$defaultAddress['area'].$defaultAddress['address']}}</span>
                <span> 收货人：{{$defaultAddress['linkman'].$defaultAddress['phone']}}</span>
            </div>
        </div>
        <div class="tij_dingd_ann">
            <a href="{{route('order.addOrder',$ids)}}">提交订单</a>
        </div>
    </div>

    <script type="text/javascript">
        $(function(){
            $(".shiq_1 ul li").hide().first().show()
            $(".cur_e p").hide().first().show()
            $(".cur_e p:first").click(
                function(){
                    $(".shiq_1 ul li").show()
                    $(".cur_e p").hide().last().show()
                }
            )
            $(".cur_e p:last").click(
                function(){
                    $(".shiq_1 ul li").hide().first().show()
                    $(".cur_e p").hide().first().show()
                }
            )
        })
        $(function(){
            $(".shiq_2 ul li").hide().first().show()
            $(".cur_e_1 p").hide().first().show()
            $(".cur_e_1 p:first").click(
                function(){
                    $(".shiq_2 ul li").show()
                    $(".cur_e_1 p").hide().last().show()
                }
            )
            $(".cur_e_1 p:last").click(
                function(){
                    $(".shiq_2 ul li").hide().first().show()
                    $(".cur_e_1 p").hide().first().show()
                }
            )
        })
        //cur
    </script>
@endsection
